import { ref, computed } from 'vue'

// 抽离了一个自定义的hook函数
// 帮助完成计数器功能

export function useCount () {

  let count = ref(1);

  let toChange = () => {
    count.value++;
  }

  let douCount = computed(() => {
    return count.value * 2;
  })
  return {
    count,
    toChange,
    douCount
  }

}